linux: Remove an unused data structure from TPM frontend.
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Thu, 8 Mar 2007 16:26:17 +0000 (16:26 +0000)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Thu, 8 Mar 2007 16:26:17 +0000 (16:26 +0000)
Some more code style changes.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
linux-2.6-xen-sparse/drivers/char/tpm/tpm_vtpm.c
linux-2.6-xen-sparse/drivers/char/tpm/tpm_vtpm.h
linux-2.6-xen-sparse/drivers/char/tpm/tpm_xen.c

index 4e841fb55a79829291c0a8fbd68bb38c6cdcdeb5..1f6982e6c2b23023e7d50bb0c0753604b27ce92f 100644 (file)
@@ -504,7 +504,6 @@ static struct tpm_vendor_specific tpm_vtpm = {
 };
 
 struct tpm_chip *init_vtpm(struct device *dev,
-                           struct tpm_virtual_device *tvd,
                            struct tpm_private *tp)
 {
        long rc;
@@ -516,7 +515,6 @@ struct tpm_chip *init_vtpm(struct device *dev,
                return ERR_PTR(-ENOMEM);
 
        vtpm_state_init(vtpms);
-       vtpms->tpmvd = tvd;
        vtpms->tpm_private = tp;
 
        chip = tpm_register_hardware(dev, &tpm_vtpm);
index 27dba1a51d2ed0e75ed05b531fb6a4687f178025..77aa342baafe1c63018b90bbe1e450fec5d8096a 100644 (file)
@@ -4,16 +4,6 @@
 struct tpm_chip;
 struct tpm_private;
 
-struct tpm_virtual_device {
-       /*
-        * This field indicates the maximum size the driver can
-        * transfer in one chunk. It is filled in by the front-end
-        * driver and should be propagated to the generic tpm driver
-        * for allocation of buffers.
-        */
-       unsigned int max_tx_size;
-};
-
 struct vtpm_state {
        struct transmission *current_request;
        spinlock_t           req_list_lock;
@@ -30,8 +20,6 @@ struct vtpm_state {
 
        unsigned long        disconnect_time;
 
-       struct tpm_virtual_device *tpmvd;
-
        /*
         * The following is a private structure of the underlying
         * driver. It is passed as parameter in the send function.
@@ -51,7 +39,6 @@ int vtpm_vd_send(struct tpm_private * tp,
 
 /* these functions are offered by tpm_vtpm.c */
 struct tpm_chip *init_vtpm(struct device *,
-                           struct tpm_virtual_device *,
                            struct tpm_private *);
 void cleanup_vtpm(struct device *);
 int vtpm_vd_recv(const struct tpm_chip* chip,
index 8b62b07724eed9590457dd9607487b8c386886a9..5488217463e581b2a9c332ffcff4d13c9a7b8bab 100644 (file)
@@ -369,10 +369,6 @@ static void backend_changed(struct xenbus_device *dev,
        }
 }
 
-struct tpm_virtual_device tvd = {
-       .max_tx_size = PAGE_SIZE * TPMIF_TX_RING_SIZE,
-};
-
 static int tpmfront_probe(struct xenbus_device *dev,
                           const struct xenbus_device_id *id)
 {
@@ -383,7 +379,7 @@ static int tpmfront_probe(struct xenbus_device *dev,
        if (!tp)
                return -ENOMEM;
 
-       tp->chip = init_vtpm(&dev->dev, &tvd, tp);
+       tp->chip = init_vtpm(&dev->dev, tp);
        if (IS_ERR(tp->chip))
                return PTR_ERR(tp->chip);
 
@@ -500,11 +496,6 @@ static void __init init_tpm_xenbus(void)
        xenbus_register_frontend(&tpmfront);
 }
 
-static void __exit exit_tpm_xenbus(void)
-{
-       xenbus_unregister_driver(&tpmfront);
-}
-
 static int tpmif_allocate_tx_buffers(struct tpm_private *tp)
 {
        unsigned int i;
@@ -530,13 +521,11 @@ static void tpmif_free_tx_buffers(struct tpm_private *tp)
 static void tpmif_rx_action(unsigned long priv)
 {
        struct tpm_private *tp = (struct tpm_private *)priv;
-
        int i = 0;
        unsigned int received;
        unsigned int offset = 0;
        u8 *buffer;
-       tpmif_tx_request_t *tx;
-       tx = &tp->tx->ring[i].req;
+       tpmif_tx_request_t *tx = &tp->tx->ring[i].req;
 
        atomic_set(&tp->tx_busy, 0);
        wake_up_interruptible(&tp->wait_q);
@@ -545,7 +534,7 @@ static void tpmif_rx_action(unsigned long priv)
 
        buffer = kmalloc(received, GFP_ATOMIC);
        if (!buffer)
-               goto exit;
+               return;
 
        for (i = 0; i < TPMIF_TX_RING_SIZE && offset < received; i++) {
                struct tx_buffer *txb = tp->tx_buffers[i];
@@ -566,10 +555,6 @@ static void tpmif_rx_action(unsigned long priv)
 
        vtpm_vd_recv(tp->chip, buffer, received, tp->tx_remember);
        kfree(buffer);
-
-exit:
-
-       return;
 }
 
 
@@ -730,13 +715,6 @@ static int __init tpmif_init(void)
 }
 
 
-void __exit tpmif_exit(void)
-{
-       exit_tpm_xenbus();
-       tpm_private_put();
-       gnttab_free_grant_references(gref_head);
-}
-
 module_init(tpmif_init);
 
 MODULE_LICENSE("Dual BSD/GPL");